<div class="wide form">

	<?php
	$form = $this->beginWidget('CActiveForm',
		array(
		'action'=>Yii::app()->createUrl($this->route),
		'method'=>'get',
		));
	?>

	<div class="row">
		<?php
		echo $form->label($model, 'employeeId');
		$criteria = array(
			'order'=>'name',
		);
		$models = Employee::model()->findAll($criteria);
		$data = CHtml::listData($models, 'id', 'name');
		$htmlOptions = array(
			'empty'=>''
		);
		echo $form->dropDownList($model, 'employeeId', $data, $htmlOptions);
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'name');
		$names = array(
			'Jamsostek',
		);
		$rows = Yii::app()->db->createCommand()
			->selectDistinct('name')
			->from($model->tableName())
			->order('name')
			->queryColumn();
		if ($rows) {
			$names = array_unique(array_merge($names, $rows));
			sort($names);
		}
		$options = array(
			'model'=>$model,
			'attribute'=>'name',
			'source'=>$names,
			'htmlOptions'=>array(
				'style'=>'height:20px;',
				'maxlength'=>128,
			),
		);
		$this->widget('zii.widgets.jui.CJuiAutoComplete', $options);
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'code');
		echo $form->textField($model, 'code', array('size'=>60, 'maxlength'=>128));
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'validFrom');
		echo $form->textField($model, 'validFrom');
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'validUntil');
		echo $form->textField($model, 'validUntil');
		?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton('Search'); ?>
	</div>

	<?php $this->endWidget(); ?>

</div><!-- search-form -->